﻿<%@ Page Language="C#" EnableEventValidation="false" AutoEventWireup="true" CodeFile="User_Edit.aspx.cs"
    Inherits="SysManage_User_Edit" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>用户修改</title>
    <base target="_self" />
    <!--#include file="../JS/TrimData.js"-->
    <!--#include file="../JS/TDTextBoxControl.js"-->
    <!--#include file="../JS/KeyControlCode.js"-->

    <script src="../JS/jquery.js" type="text/javascript"></script>

    <script src="../JS/jquery-vsdoc.js" type="text/javascript"></script>

    <link rel="stylesheet" href="../css/css.css" type="text/css" />

    <script language="javascript" type="text/javascript">
     <!--
        /////调用人员选择树      
        //选择人员信息
        var sChoiceID;              //所在赋值的关键字  
        var ChoiceNameInfo;         //选择的名称集合

        var ChoiceIDInfo;           //选择的ID集合
        var iChoicePoNumber1 = 1;     //0表示任意多,其它的正整数为可以选择的最大个数.不可以为负数      
        function GetMyPersTree(obj) {
            var sOrgIDCol = form1.HOrgIDCol.value;
            var sFeatures = "dialogHeight:600px;dialogWidth:700px;resizeable:no;help:no;status:no";
            var obj = showModalDialog("ChoicePersInfo.aspx?ChoiceID=" + obj + "&OrgType=2&OrgIDCol=" + sOrgIDCol, window, sFeatures);
            if (obj != undefined) {
                sChoiceID = obj.sChoiceID;
                ChoiceNameInfo = obj.ChoiceNameInfo;
                ChoiceIDInfo = obj.ChoiceIDInfo;
                eval("form1.ChoiceName_" + sChoiceID + ".value=" + ChoiceNameInfo + ";");
                eval("form1.HChoiceID_" + sChoiceID + ".value=" + ChoiceIDInfo + ";");
                eval("form1.HNewChoiceID_" + sChoiceID + ".value=" + ChoiceIDInfo + ";");
                eval("form1.ChoiceName_" + sChoiceID + ".blur()");
            }
        }

        //选择组织信息
        var sChoiceID;               //所在赋值的关键字
        var ChoiceNameInfo;          //选择的名称集合
        var ChoiceIDInfo;            //选择的ID集合
        var iChoicePoNumber2 = 0;     //0表示任意多,其它的正整数为可以选择的最大个数.不可以为负数     
        function GetMyOrgTree(obj) {
            var sOrgIDCol = form1.HOrgIDCol.value;
            var sFeatures = "dialogHeight:600px;dialogWidth:400px;resizeable:no;help:no;status:no";
            var obj = showModalDialog("ChoiceOrgInfo.aspx?ChoiceID=" + obj + "&OrgType=2&OrgIDCol=" + sOrgIDCol, window, sFeatures);
            if (obj != undefined) {
                sChoiceID = obj.sChoiceID;
                ChoiceNameInfo = obj.ChoiceNameInfo;
                ChoiceIDInfo = obj.ChoiceIDInfo;
                eval("form1.ChoiceName_" + sChoiceID + ".value=" + ChoiceNameInfo + ";");
                eval("form1.HChoiceID_" + sChoiceID + ".value=" + ChoiceIDInfo + ";");
                eval("form1.ChoiceName_" + sChoiceID + ".blur()");
            }
        }

        //选择用户组

        var sPageUserGroupInfo;
        var ChoiceUserGroupNameInfo;
        var ChoiceUserGroupIDInfo;
        var iChoiceUserGroupNumber1 = 1;
        function GetMyUserGroupTree(obj) {
            var sFeatures = "dialogHeight:600px;dialogWidth:400px;resizeable:no;help:no;status:no";
            var obj = showModalDialog("ChoiceUserGroupInfo.aspx?PageID=" + obj, window, sFeatures);
            if (obj != undefined) {
                sPageUserGroupInfo = obj.sPageUserGroupInfo;
                ChoiceUserGroupNameInfo = obj.ChoiceUserGroupNameInfo;
                ChoiceUserGroupIDInfo = obj.ChoiceUserGroupIDInfo;
                eval("form1.ChoiceUserGroupName_" + sPageUserGroupInfo + ".value=" + ChoiceUserGroupNameInfo + ";");
                eval("form1.HChoiceUserGroupID_" + sPageUserGroupInfo + ".value=" + ChoiceUserGroupIDInfo + ";");
                eval("form1.ChoiceUserGroupName_" + sPageUserGroupInfo + ".blur();");
            }
        }   
      -->
    </script>

    <script language="javascript" type="text/javascript">
        function matchStationId(obj) {
            //SysManage_User_Edit.getMatchStation(obj, CallBack);
            $.ajax({
                type: "Post",
                url: "User_Edit.aspx/getMatchStation",
                data: "{sStation:'" + obj + "'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function(data) {
                    CallBack(data)
                },
                error: function(err) {
                    alert(err);
                }
            });
        }
        function CallBack(response) {
            var matchddl = form1.DbRoleName;
            matchddl.options.length = 0;
            if (response.d != null) {
                for (var i = 0; i < response.d.length; ++i) {
                    var arry = response.d[i].split("|")
                    var no = new Option();
                    no.value = arry[0];
                    no.text = arry[1];
                    matchddl.options.add(no);
                    if (i == 0) {
                        form1.HAjaxDropID.value = arry[0];
                    }
                }
            }
        }
        function selectthis(sel1) {
            form1.HAjaxDropID.value = sel1.options[sel1.selectedIndex].value;
        }
			
    </script>

</head>
<body style="background-image: url('../images/hit_bg.gif');">
    <% 
        Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
        Response.Expires = 0;
        Response.CacheControl = "no-cache";
    %>
    <form id="form1" method="post" runat="server">
    <input type="hidden" id="HOrgIDCol" runat="server" />
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td width="15%" height="18" valign="top" background="../images/tablelb.gif" class="font13">
                <div align="left">
                    <img height="18" src="../images/tablelbleft.gif" width="18"></div>
            </td>
            <td width="2%" valign="top" background="../images/tablelb.gif" bgcolor="#ffffff"
                class="font13">
                <div align="right">
                    <img height="18" src="../images/tablelbright.gif" width="12"></div>
            </td>
            <td colspan="2" valign="center" bgcolor="#ffffff" class="font13">
                <div align="right">
                </div>
            </td>
        </tr>
        <tr>
            <td height="26" colspan="2" valign="center" bgcolor="#e9ecf5" class="font13">
                <div align="center">
                    用户管理</div>
            </td>
            <td width="80%" height="26" valign="bottom" background="../images/tddi.gif" class="font13">
                <div align="right">
                </div>
            </td>
            <td width="3%" valign="top" background="../images/tddi.gif" class="font13">
                <div align="right">
                    <img height="26" src="../images/tddir.gif" alt="" /></div>
            </td>
        </tr>
    </table>
    <table width="98%" height="107" border="0" align="center" cellpadding="0" cellspacing="0"
        bgcolor="#e9ecf5">
        <tr>
            <td height="147" valign="top">
                <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="tablelsdi">
                    <tr>
                        <td width="4%" background="../images/tablelb01.gif">
                            <img src="../images/tablelb01-left.gif" width="21" height="22">
                        </td>
                        <td width="82%" background="../images/tablelb01.gif" class="font12w">
                            用户编辑
                        </td>
                        <td width="14%" background="../images/tablelb01.gif">
                            <div align="right">
                                <img src="../images/tablelb01-right.gif" width="21" height="22" alt="" /></div>
                        </td>
                    </tr>
                </table>
                <input type="hidden" id="UserID" runat="server" />
                <input type="hidden" id="RoleCode" runat="server" />
                <input type="hidden" id="PersID" runat="server" />
                <input type="hidden" id="NewPersID" runat="server" />
                <input type="hidden" id="hidEditType" runat="server" />
                <input type="hidden" id="HOrgID" runat="server" />
                <input type="hidden" id="hPersID1" runat="server" />
                <input type="hidden" id="NewPersID1" runat="server" />
                <input type="hidden" id="hFirstPage" runat="server" />
                <input type="hidden" id="HLogonID" runat="server" />
                <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="tablelb">
                    <tr style="height: 26px;">
                        <td style="width: 15%;" bgcolor="#E1EEFD" class="tableleft" align="right">
                            用户帐户&nbsp;
                        </td>
                        <td style="width: 35%;" bgcolor="#E1EEFD" class="tableleft">
                            <asp:TextBox ID="LogonID" runat="server" Width="100px" TabIndex="1" MaxLength="20"></asp:TextBox><asp:Label
                                ID="tishi1" runat="server" Text="*" ForeColor="Red"></asp:Label>
                        </td>
                        <td style="width: 15%;" bgcolor="#E1EEFD" class="tableleft" align="right">
                            别名&nbsp;
                        </td>
                        <td style="width: 35%;" bgcolor="#E1EEFD" class="tableleft">
                            <asp:TextBox ID="Alias" runat="server" Width="100px" TabIndex="2" MaxLength="20"></asp:TextBox>
                        </td>
                    </tr>
                    <tr style="height: 26px;">
                        <td bgcolor="#ECF4FD" class="tableleft" align="right">
                            <label id="sjzx" onclick="GetMyPersTree(1)" runat="server">
                                人员名称</label>
                            &nbsp;
                        </td>
                        <td bgcolor="#ECF4FD" class="tableleft">
                            <asp:TextBox ID="ChoiceName_1" runat="server" TabIndex="3" onclick="GetMyPersTree(1)"
                                Width="100px"></asp:TextBox>
                            <input type="hidden" id="HChoiceID_1" runat="server" />
                            <input type="hidden" id="HNewChoiceID_1" runat="server" />
                            <asp:Label ID="Label2" runat="server" Text="*" ForeColor="Red"></asp:Label>
                        </td>
                        <td bgcolor="#ECF4FD" class="tableleft" align="right">
                            帐户状态&nbsp;
                        </td>
                        <td bgcolor="#ECF4FD" class="tableleft">
                            <asp:DropDownList ID="Effective" TabIndex="6" runat="server" Enabled="true" Width="60px">
                                <asp:ListItem Value="1" Selected="true">开启</asp:ListItem>
                                <asp:ListItem Value="0">关闭</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr style="height: 26px;">
                        <td bgcolor="#E1EEFD" class="tableleft" align="right">
                            功能角色&nbsp;
                        </td>
                        <td bgcolor="#E1EEFD" class="tableleft">
                            <asp:DropDownList ID="RoleName" DataValueField="Code" DataTextField="Name" runat="server">
                            </asp:DropDownList>
                            <asp:Label ID="Label10" runat="server" Text="*" ForeColor="Red"></asp:Label>
                        </td>
                        <td bgcolor="#E1EEFD" class="tableleft" align="right">
                            数据角色&nbsp;
                        </td>
                        <td bgcolor="#E1EEFD" class="tableleft">
                            <asp:DropDownList ID="DbRoleName" DataValueField="Role_Code" DataTextField="Role_Name"
                                onchange="selectthis(this)" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr style="height: 26px;">
                        <td bgcolor="#ECF4FD" class="tableleft" align="right" onclick="GetMyUserGroupTree(1)">
                            用户组&nbsp;
                        </td>
                        <td bgcolor="#ECF4FD" class="tableleft">
                            <asp:TextBox ID="ChoiceUserGroupName_1" runat="server" TabIndex="3" onclick="GetMyUserGroupTree(1)"
                                Width="100px"></asp:TextBox>
                            <input type="hidden" id="HChoiceUserGroupID_1" runat="server" />
                        </td>
                        <td bgcolor="#ECF4FD" class="tableleft" align="right">
                            隶属区域&nbsp;
                        </td>
                        <td bgcolor="#ECF4FD" class="tableleft">
                            <asp:DropDownList ID="DDLArea" TabIndex="6" DataTextField="Name" DataValueField="ID" runat="server" Enabled="true" Width="60px">
                            </asp:DropDownList>
                        </td>
                        <!--<td bgcolor="#ECF4FD" class="tableleft"  align ="right" onclick ="GetMyOrgTree(2)">可访问资源树&nbsp;</td>
        <td bgcolor="#ECF4FD" class="tableleft">
           <asp:TextBox ID="ChoiceName_2" runat ="server" onclick ="GetMyOrgTree(2)" TabIndex ="1" Width="100px" ></asp:TextBox>
           <input type="hidden" id="HChoiceID_2" runat ="server" />
        </td>-->
                    </tr>
                    <!--
      <tr>
        <td bgcolor="#E1EEFD" class="tableleft" align ="right">首页&nbsp;</td>
        <td bgcolor="#E1EEFD" class="tableleft">
        <asp:DropDownList ID="first_Page" DataValueField ="id" DataTextField ="label" runat ="server"></asp:DropDownList></td>
      </tr>-->
                </table>
            </td>
        </tr>
    </table>
    <table width="95%" border="0" cellpadding="5" cellspacing="0" align="center">
        <tr>
            <td align="center">
                <input id="GrantBtn1" type="submit" runat="server" class="button03" value="提交(S)"
                    accesskey="s" onserverclick="GrantBtn1_ServerClick" />
                &nbsp;&nbsp;
                <input type="button" id="backBtn" value="返回(C)" accesskey="c" class="button03" onclick="window.close();" />
            </td>
        </tr>
    </table>
    <input type="hidden" id="HAjaxDropID" runat="server" />
    <input type="hidden" id="HThisCode" runat="server" />
    </form>

    <script language="javascript" type="text/javascript"> function jsTrim(str)
    {
    return str.replace(/(^\s*)|(\s*$)/g, ""); 
    }
    <!--
      var sData = dialogArguments;
      form1.hidEditType.value = sData.stype ;
      if(sData.stype == "2")  // 2 修改 1 新建
      {
        var sobj = sData.UserForm.Hcode.value;
        var ary=sobj.split('|'); 
        form1.UserID.value = trim(ary[0]);     //流水号

        form1.LogonID.value = trim(ary[1]);   //登陆号

        form1.HLogonID.value = trim(ary[1]);   //登陆号

        form1.Alias.value = trim(ary[2]);     //别名
        form1.HOrgID.value = ary[3];          //
        form1.HChoiceID_1.value = ary[3]+",";
        form1.HNewChoiceID_1.value = ary[3]+",";
        form1.ChoiceName_1.value = trim(ary[4]);
        //form1.RoleCode.value = ary[5];
        form1.RoleName.value = jsTrim(ary[5]);
      
        //form1.first_Page.value = trim(ary[10]);
        //form1.hFirstPage.value = trim(ary[7]);
        
        form1.Effective.value = trim(ary[9]);       //是否有效
        form1.ChoiceUserGroupName_1.value = trim(ary[12]);   //用户组

        form1.HChoiceUserGroupID_1.value  = '1^'+trim(ary[13]);    //用户组

        form1.DbRoleName.value = trim(ary[14]);       //数据角色
//        form1.ChoiceName_2.value = trim(ary[16]);       //树节点名称

//        form1.HChoiceID_2.value = trim(ary[17]);       //树节点ID
      }
    -->
    </script>

</body>
</html>
